{extend name=".././view/create.html" /}
{block name="jscss"}
<style type="text/css">
  html, body{
    height: 100%;
    margin: 0px;
  }
  #upload{
    width: 320px;
    height: 80px;
    padding-top: 80px;
  }
</style>
{/block}
{block name="form"}
  <div class="layui-fluid" style="text-align: center;">
    <div class="layui-upload-drag" id="upload">
      <i class="layui-icon"></i>
      <p>点击上传，或将文件拖拽到此处</p>
      <div class="layui-hide" id="uploadDemoView">
      </div>
    </div>
  </div>
{/block}

{block name="myjs"}
<script>

layui.use('upload', function(){
  var upload = layui.upload;

  //拖拽上传
  upload.render({
    elem: '#upload'
    ,url: "{$list.set.url}" //改成您自己的上传接口
    ,async:false
    ,done: function(res){
      layer.msg('上传成功');
      layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', res.files.file);
    }
    ,data: {
      text: '立项图片'
      ,serurl:'keti\\lixiang'
    }
    ,multiple:true
    ,number:100
    ,acceptMime:'.jpg,.jpeg,.png'
    ,exts:'jpg|jpeg|png'
    ,auto:true
    ,error: function(){
      //请求异常回调
      layer.msg('上传错误');
    }
  });
});

</script>
{/block}

